<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import ="readFromDB.GetStudent" %>
<%@ page import ="java.util.List" %>
<%@ page import ="classes.Students" %>
<!DOCTYPE html>
<html>
<head>
<div align="left">
	<ul>
		<li><a href="http://localhost:8080/my_term_project_xuanke/admin/admin_home.jsp">返回主页</a></li>
		<li><a href="http://localhost:8080/my_term_project_xuanke/admin/look_course.jsp">查看课程信息</a></li>
		<li><a href="http://localhost:8080/my_term_project_xuanke/admin/add_student.jsp">新增学生信息</a></li>
		<li><a href="http://localhost:8080/my_term_project_xuanke/admin/add_course.jsp">新增课程信息</a></li>
		<li><a href="http://localhost:8080/my_term_project_xuanke/admin/select_student.jsp">查找已有学生</a></li>
		<li><a href="http://localhost:8080/my_term_project_xuanke/admin/select_course.jsp">查找已有课程</a></li>	
	</ul>
</div>
<meta charset="UTF-8">
<title>查看学生信息</title>
<!-- 处理反馈 -->
		<%
		 request.setCharacterEncoding("UTF-8");
		 String message=String.valueOf((request.getSession().getAttribute("look_student_message")));
		 %>
<script src="http://localhost:8080/my_term_project_xuanke/resource/paging.js">
	var message="<%=message %>"
	if(message.length!=0&&message!="null"){
		alert(message);
		<%request.getSession().setAttribute("look_student_message","");%>
	}
	
</script>
</head>
 <body onLoad="goPage(1,15);">
<%	String ID=String.valueOf((request.getSession().getAttribute("ID"))); %>
<h2 align="center">欢迎<%=ID %>管理员查看学生信息</h1>
<table id="show" border="1" align="center">
       <tr>
         <th>学号</th>
         <th>姓名</th>
         <th>年级</th>
         <th>专业</th>
         <th>学院</th>
		 <th>密码</th>
		 <th>手机号码</th>		
		 <th>已修课程</th>
		 <th>修改</th> 
		 <th>删除</th> 		 
       </tr>
        <%
           GetStudent get=new GetStudent();
           List<Students> list = get.getByTableName("student");  
           for(Students student:list)
           {%>
         <tr>
              <td><%=student.getStuId() %></td>
              <td><%=student.getStuName() %></td>
              <td><%=student.getStuGrage()  %></td>
              <td><%=student.getStuProfess() %></td>
              <td><%=student.getStuInstitute()  %></td>
              <td><%=student.getStuPwd() %></td>     
              <td><%=student.getStuPhhone() %></td>
              <td><%=student.getStuCourselearned() %></td>
              <%
              String url="http://localhost:8080/my_term_project_xuanke/admin/alter_student.jsp?Sno=";
              String stuID=student.getStuId();
              String alter=url+stuID;
              String serveletUrl="http://localhost:8080/my_term_project_xuanke/adminServlet?";
              String delete=serveletUrl+"action=delete_student&Sno="+stuID;
              %> 
              <td><a href="<%=alter%>"><input type="button"  value="修改"/></a></td>
              <td><a href="<%=delete%>"><input type="button"  value="删除"/></a></td>
           </tr>
             <%}
        %>
        	<table align="right" style="margin:20px 400px 0px 20px">
		     <tr><td> <div  id="barcon" name="barcon" ></div></td></tr>
			</table>
   </table>

</body>
</html>